<script type="text/javascript">

    {literal}   
    $(document).ready(function () {
                 
    });    
    {/literal}        
</script>
<div class='documentListHeader'>   
  <span id='valuatorTitle'> {translate p1=$imTicketCode p2=$createDate}Valuate for import ticket [%s - %s]{/translate} </span>
</div>
<br>
<div  class="form_container" style="float: none; ">
<span id="valuateStatusMessage" style="color: red; font-style: italic;">&nbsp;</span>
<input type="hidden" id="valuatingImTicketId" value="{$imTicketId}">
    <form id="valuateForm" action="">
            <table cellspacing="0" cellpadding="0" style='width: 100%;'>
                <tr>
                    <td>
                        <span class="label">{translate}Valuate method{/translate}</span>
                    </td>
                    <td>
                        <select style="width: 145px;" tabindex="2" id="valuateMethodSel">
                           {html_options options=$arrMethod  selected=$selectedMethod}
                        </select>
                    </td>  
                </tr>
                <tr>     
                    <td><span class="label">{translate}Service fee{/translate}</span>
                    </td>       
                    <td >                       
                        <input type="button" id="serviceFeeRateInpSign" value="+">
                        <input onkeypress="return allowEnterIntegerNum(event,true)" type="text" id="serviceFeeRateInp">                     
                        <span class="label">{translate}Insurrance{/translate}</span>
                        <input type="button" id="insurranceRateInpSign" value="+">
                        <input onkeypress="return allowEnterIntegerNum(event,true)" type="text" id="insurranceRateInp">                     
                        <input type="radio" name="rateTypeRd"  value="1" checked="checked" />
                        <label for="percenRateTypeRd">%</label>
                        <input type="radio" name="rateTypeRd" value="2" />
                        <label for="cashRateTypeRd">VND</label>                                                                        
                    </td>
                    <td>
                        <input type="checkbox" id="AllowSellAll" checked="checked"/><label>{translate}Allow sell{/translate}</label>
                        <input type="button" id="applyValuateBtn" value="{translate}Apply{/translate}" onclick="javascript:applyValuation4ImTicket()" disabled="disabled"/>
                        <input type="button" id="finalizeBtn" value="{translate}Finalize{/translate}" onclick="javascript:finalize('{$imTicketId}')"/>
                        <input type="button" id="backBtn" value="{translate}Back{/translate}" onclick="javascript:backToSearchPage()"/>
                    </td>
                </tr>                     
            </table>        
    </form> 
    <!-- 
    <span style="color: red;">*{translate}Only valuate for drug/material not valuated yet{/translate}</span> 
    -->     
</div>
<div id="actionResultArea">
<div style="margin-top: 10px; width: 100%;" class="lab_grid">
<div class="h_div">
<table cellspacing="0" cellpadding="0">
    <thead>
        <tr>
            <th style="width: 30px;">{translate}Order number{/translate}</th>
            <th style="width: 150px;">{translate}Name{/translate}</th>
            <th style="width: 60px;">{translate}Lot{/translate}</th>
            <th style="width: 60px;">{translate}Allow sell{/translate}</th>
            <th style="width: 145px;">{translate}Expired date{/translate}</th>
            <th style="width: 80px;">{translate}Import Qty{/translate}</th>
            <th style="width: 80px;">{translate}Remain Qty{/translate}</th>
            <th style="width: 80px;">{translate}Unit price{/translate}</th>
            <th style="width: 80px;">{translate}Service price{/translate}</th>
            <th style="border-right: none;" class="last">{translate}Insurrance price{/translate}</th>                       
        </tr>
    </thead>
</table>
</div>
<div class="b_div" style="height: 250px; border-top: 1px solid #DDDDDD;" >
<table id="drugMaterialTable" cellspacing="0" cellpadding="0" border="0" >
    <tbody>
	{assign var="count1" value=1}		
	{foreach from=$listDMItems item=item}
	        <tr id="{$item.pha_ewh_imticket_detail_id}">        
	            <td width="30px;">{$count1++}</td>
	            <td ><div style="width: 150px;white-space: normal;">{$item.proprietary_name}</div></td>
	            <td ><div style="width: 60px;white-space: normal;">{$item.im_lot}</div></td>
	            <td width="60px">
	               {if $item.allow_sell==1 }
	                   {if $item.valuated==1 } 
	                       <input type="checkbox" id="allowSellCheck{$item.pha_ewh_imticket_detail_id}" checked="checked" onchange="javascript:allowSel('{$item.pha_ewh_imticket_id}','{$item.pha_ewh_imticket_detail_id}')">
	                   {else}
	                       <input type="checkbox" id="allowSellCheck{$item.pha_ewh_imticket_detail_id}" checked="checked" disabled="disabled" onchange="javascript:allowSel('{$item.pha_ewh_imticket_id}','{$item.pha_ewh_imticket_detail_id}')">
	                   
	                   {/if}
	               {else}
	                   {if $item.valuated==1 } 
                           <input type="checkbox" id="allowSellCheck{$item.pha_ewh_imticket_detail_id}" onchange="javascript:allowSel('{$item.pha_ewh_imticket_id}','{$item.pha_ewh_imticket_detail_id}')">
                       {else}
                           <input type="checkbox" id="allowSellCheck{$item.pha_ewh_imticket_detail_id}" disabled="disabled" onchange="javascript:allowSel('{$item.pha_ewh_imticket_id}','{$item.pha_ewh_imticket_detail_id}')">                       
                       {/if}	               
	               {/if}
	            </td>
	            <td ><div style="width: 145px;white-space: normal;">{$item.im_expired_date_formatted}</div></td>
	            <td ><div style="width: 80px;white-space: normal;">{$item.im_quantity_formatted}</div></td>
	            <td ><div style="width: 80px;white-space: normal;">{$item.remain_quantity_formatted}</div></td>
	            <td ><div style="width: 80px;white-space: normal;">{$item.im_unit_price_formatted}</div></td>
	            <td ><div style="width: 80px;white-space: normal;">{$item.service_price_formatted}</div></td>
	            <td style="border-right: none;"><div>{$item.insurance_price_formatted}</div></td>	            
	        </tr>
	{/foreach}	
    </tbody>
</table>
</div>
</div>
</div>